package com.company;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一串二进制的长度:");
        int len = sc.nextInt();
        int[] nums = new int[len];
        System.out.println("请输入一串二进制");
        String num = sc.next();
        for(int i = 0; i < len; i++){
            nums[i] = num.charAt(i) - '0';
        }

        System.out.println(prefixesDivBy5(nums));

    }

    public static List<Boolean> prefixesDivBy5(int[] nums) {
        List<Boolean> result = new ArrayList<>();
        int index = 0;
        for (int i = 0; i < nums.length; i++){
            index = (index * 2 + nums[i]) % 10;
            result.add(index % 5 == 0);
        }
        return  result;
    }
}
